package com.zero.book.entity;

/**
 * @author Zero
 * @version 1.0.0
 * @date 2025/01/19
 * @description 书籍建造类（采用了建造者模式）
 */
public class BookBuilder{
    private String title;
    private String author;
    private Double price;


    public BookBuilder(String title, String author, double price) {
        this.title = title;
        this.author = author;
        this.price = price;
    }

    public BookBuilder(){}

    public BookBuilder title(String title){
        this.title = title;
        return this;
    }
    public BookBuilder author(String author){
        this.author = author;
        return this;
    }
    public BookBuilder price(double price){
        this.price = price;
        return this;
    }

    public Book build(){
        return new Book(title,author,price);
    }
}
